<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>Untitled</title>
	<LINK REL="stylesheet" TYPE="text/css" HREF="style/editor.css">
	<style>
		td {
			font-family: Arial;
			font-size: 10;
		}
		.td1 {
			background-color: #b9b9b9;
		}
		.td2 {
			background-color: #e0e0e0;
		}
		.tdhead {
			background-color: #515151;
			color: white;
		}
	</style>
	<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
    <!--
    function removeFile(filename, displayname) {
		if (confirm("Verwijder " + displayname + "?")) {
			self.location.href = "action.asp?command=rmmsg&file=" + filename;
		}
	}
    //-->
    </SCRIPT>
</head>

<body bgcolor="#FFFFF0" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" scroll="yes">

<%

pad = Server.MapPath(".\input\4kabelkrant")
Set fs = CreateObject("Scripting.FileSystemObject")
Set folder = fs.getfolder(pad)

i = -1
for each file in folder.files
	i = i + 1
	redim preserve datecreated(i)
	redim preserve name(i)
	redim preserve size(i)
	datecreated(i) = file.datecreated
	name(i) = file.name
	size(i) = file.size
next

if isArray(name) then
' bubblesort the array
for x = lbound(name) to ubound(name)
	for y = x to ubound(name)
		if datecreated(y) > datecreated(x) then
			' swap
			tmp = datecreated(x)
			datecreated(x) = datecreated(y)
			datecreated(y) = tmp
			' swap 2
			tmp = name(x)
			name(x) = name(y)
			name(y) = tmp
			' swap 3
			tmp = size(x)
			size(x) = size(y)
			size(y) = tmp
		end if
	next
next

toggle = false
divided = false
response.write "<table width=""100%"" cellpadding=""2"" cellspacing=""0""><tr><td class=tdhead><b>Bestand</b></td><td class=tdhead><b>Datum</b></td><td class=tdhead><b>Size (bytes)</b></td><td class=tdhead>Del</td></tr>"
for i = lbound(name) to ubound(name)
	href = "<a href=""input/4kabelkrant/" & name(i) & """ target=""_blank""><font color=""black"">" & name(i) & "</font></a>"
	' href = "<a href=""email.asp?f=" & name(i) & """ target=""_blank""><font color=""black"">" & name(i) & "</font></a>"
	rmhref = "<a href=""javascript:removeFile('" & server.urlencode(replace(name(i), "'", "\'")) & "', '" & server.URLencode(name(i)) & "');"">"
	created = day(datecreated(i)) & "-" & month(datecreated(i)) & "-" & year(datecreated(i))
	if toggle then
		response.write "<tr><td class=td1>" & href & "</td><td class=td1>" & created & "</td><td align=""right"" class=td1>" & size(i) & "</td><td class=td1>" & rmhref & "<img src=""images/stoplink.gif"" width=""16"" height=""16"" alt=""verwijder " & name(i) & """ border=""0""></a></td></tr>"
	else
		response.write "<tr><td class=td2>" & href & "</td><td class=td2>" & created & "</td><td align=""right"" class=td2>" & size(i) & "</td><td class=td2>" & rmhref & "<img src=""images/stoplink.gif"" width=""16"" height=""16"" alt=""verwijder " & name(i) & """ border=""0""></a></td></tr>"
	end if
	if (now() - datecreated(i)) > 5 and not divided then
		response.write "<tr height=""2""><td colspan=4 bgcolor=red></td></tr>"
		divided = true
	end if
	' file.datelastmodified
	toggle = not toggle
next
response.write "</table>"

else
	response.write "<br><p>&nbsp;Geen berichten.</p>"
end if

Set folder = nothing
Set fs = nothing

%>

</body>
</html>